//
//  CineLabelTableViewCell.m
//  UI_APP_Project_Bean
//
//  Created by dllo on 16/6/25.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CineLabelTableViewCell.h"
#import "GetHeightTools.h"
#import "DetiledMovieModel.h"

@interface CineLabelTableViewCell ()
@property(nonatomic, retain)UILabel *story;
@property(nonatomic, retain)UILabel *storyText;


@end


@implementation CineLabelTableViewCell
- (void)dealloc
{
    [_detiledModel release];
    [_story release];
    [_storyText release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.story = [[UILabel alloc]init];
        _story.font = [UIFont fontWithName:@"Damascus" size:21];
        [self.contentView addSubview:_story];
        [_story release];
        
        self.storyText = [[UILabel alloc]init];
        self.storyText.numberOfLines = 0;
        [self.contentView addSubview:_storyText];
        [_storyText release];

        
        
    }
    return self;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    
    self.story.frame = CGRectMake(15, 115, self.contentView.frame.size.width-30, 30);
    self.story.text = @"电影情节";
    
    CGFloat height = [GetHeightTools heightWith:self.detiledModel.plot_simple];
    self.storyText.frame = CGRectMake(_story.frame.origin.x, _story.frame.origin.y+30, CGRectGetWidth(self.bounds)-30, height + 50);
  
    
}

-(void)setDetiledModel:(DetiledMovieModel *)detiledModel{
    if (_detiledModel != detiledModel) {
        [_detiledModel release];
        _detiledModel = [detiledModel retain];
    }
    
    self.storyText.text = detiledModel.plot_simple;
    
}


@end
